<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <title>患者退血申请</title>
    <link rel="shortcut icon" type="image/x-icon" href="../../../../img/favicon.ico">
    <link rel="stylesheet" href="../../../../element-theme/blue/index.css">
    <style type="text/css">
        .tableLimit tr td .cell {
            overflow: hidden;
            text-overflow: ellipsis;
            display: -webkit-box;
            -webkit-line-clamp: 1; /*可以显示的行数，超出部分用...表示 */
            -webkit-box-orient: vertical;
        }

        .el-form-item {
            margin: 20px 20px 0 0;
        }
    </style>
</head>
<body>

<div class="data-manage-table">
    <template>

        <el-form ref="form" :inline="true" style="padding:5px 20px 20px 20px;">
            <el-form-item label="患者病历号">
                <el-input placeholder="请输入待退血患者病历号" v-model="record"></el-input>
            </el-form-item>
            <el-form-item>
                <el-button type="primary" @click="search">搜索</el-button>
            </el-form-item>
            <el-form-item>
                <el-button type="info" @click="reset">清空</el-button>
            </el-form-item>
            <el-form-item>
                <el-button type="danger" @click="batchDownload()">批量下载</el-button>
            </el-form-item>
            <el-form-item>
                <el-button type="danger">批量删除</el-button>
            </el-form-item>
        </el-form>

        <el-table ref="backApplicationTable" :data="dataList" style="width: 100%" border
                  :header-cell-style="{'text-align': 'center','background': '#eef1f6'}" highlight-current-row
                  class="tableLimit" @row-click="handle" :cell-style="{'text-align':'center'}">
            <el-table-column type="selection"></el-table-column>
            <el-table-column prop="id" label="ID">
                <template slot-scope="scope">
                    <el-button type="text" @click="showData">{{scope.row.id}}</el-button>
                </template>
            </el-table-column>
            <el-table-column prop="gmtCreate" label="创建时间"></el-table-column>
            <el-table-column prop="gmtModified" label="修改时间"></el-table-column>
            <el-table-column prop="transfusionNumber" label="输血单号"></el-table-column>
            <el-table-column prop="name" label="患者姓名"></el-table-column>
            <el-table-column prop="patientId" label="患者ID"></el-table-column>
            <el-table-column prop="createTime" label="创建订单时间"></el-table-column>
            <el-table-column prop="payMoney" label="支付金额"></el-table-column>
            <el-table-column prop="aboBloodType" label="ABO血型">
                <template slot-scope="scope">
                    {{getAboTypeName(scope.row.aboBloodType)}}
                </template>
            </el-table-column>
            <el-table-column prop="rhBloodType" label="RH血型">
                <template slot-scope="scope">
                    {{getRhTypeName(scope.row.rhBloodType)}}
                </template>
            </el-table-column>
            <el-table-column prop="bloodCount" label="血液数量">
                <template slot-scope="scope">
                    {{getBloodSizeName(scope.row.bloodCount)}}
                </template>
            </el-table-column>
            <el-table-column prop="department" label="科别">
                <template slot-scope="scope">
                    {{getDepartmentName(scope.row.department)}}
                </template>
            </el-table-column>
            <el-table-column prop="state" label="状态">
                <template slot-scope="scope">
                    {{getStateName(scope.row.state)}}
                </template>
            </el-table-column>
            <el-table-column prop="bloodId" label="血液编号"></el-table-column>
            <el-table-column label="操作" align="center">
                <template slot-scope="scope">
                    <el-button size="mini" type="danger" @click="backBlood">退血</el-button>
                </template>
            </el-table-column>
        </el-table>

        <!--分页组件-->
        <div class="pagination-container">
            <el-pagination
                    class="pagination"
                    @size-change="handleSizeChange"
                    @current-change="handleCurrentChange"
                    :current-page="pagination.currentPage"
                    :page-sizes="[2,4,6,8,10]"
                    :page-size="pagination.pageSize"
                    layout="total, sizes, prev, pager, next, jumper"
                    :total="pagination.total"
                    style="text-align: center; margin-top: 20px;">
            </el-pagination>
        </div>

        <el-dialog title="患者输血信息" center :visible.sync="sData" width="90%" :close-on-click-modal="false">
            <template>
                <el-descriptions class="margin-top" :column="3" :size="size" border>
                    <el-descriptions-item>
                        <template slot="label">
                            <i class="el-icon-user"></i>
                            输血单号
                        </template>
                        {{shData.sTransfusionNumber}}
                    </el-descriptions-item>
                    <el-descriptions-item>
                        <template slot="label">
                            <i class="el-icon-user"></i>
                            创建时间
                        </template>
                        {{shData.sGmtCreate}}
                    </el-descriptions-item>
                    <el-descriptions-item>
                        <template slot="label">
                            <i class="el-icon-user"></i>
                            修改时间
                        </template>
                        {{shData.sGmtModified}}
                    </el-descriptions-item>
                    <el-descriptions-item>
                        <template slot="label">
                            <i class="el-icon-user"></i>
                            患者ID
                        </template>
                        {{shData.sPatientId}}
                    </el-descriptions-item>
                    <el-descriptions-item>
                        <template slot="label">
                            <i class="el-icon-user"></i>
                            创建订单时间
                        </template>
                        {{shData.sCreateTime}}
                    </el-descriptions-item>
                    <el-descriptions-item>
                        <template slot="label">
                            <i class="el-icon-user"></i>
                            血液数量
                        </template>
                        {{getBloodSizeName(shData.sBloodCount)}}
                    </el-descriptions-item>
                    <el-descriptions-item>
                        <template slot="label">
                            <i class="el-icon-user"></i>
                            科别
                        </template>
                        {{getDepartmentName(shData.sDepartMent)}}
                    </el-descriptions-item>
                    <el-descriptions-item>
                        <template slot="label">
                            <i class="el-icon-user"></i>
                            状态
                        </template>
                        {{getStateName(shData.sState)}}
                    </el-descriptions-item>
                    <el-descriptions-item>
                        <template slot="label">
                            <i class="el-icon-user"></i>
                            血液编号
                        </template>
                        {{shData.sBloodId}}
                    </el-descriptions-item>
                    <el-descriptions-item>
                        <template slot="label">
                            <i class="el-icon-user"></i>
                            患者姓名
                        </template>
                        {{shData.sName}}
                    </el-descriptions-item>
                    <el-descriptions-item>
                        <template slot="label">
                            <i class="el-icon-user"></i>
                            支付金额
                        </template>
                        {{shData.sPayMoney}}
                    </el-descriptions-item>
                    <el-descriptions-item>
                        <template slot="label">
                            <i class="el-icon-user"></i>
                            ABO血型
                        </template>
                        {{getAboTypeName(shData.sAboBloodType)}}
                    </el-descriptions-item>
                    <el-descriptions-item>
                        <template slot="label">
                            <i class="el-icon-user"></i>
                            RH血型
                        </template>
                        {{getRhTypeName(shData.sRhBloodType)}}
                    </el-descriptions-item>
                </el-descriptions>
            </template>
        </el-dialog>

        <el-dialog title="患者退血申请" center :visible.sync="setData" width="90%" :close-on-click-modal="false">
            <template>
                <el-form :model="ruleForm" ref="ruleForm" label-width="100px" label-position="right" :rules="rules"
                         :inline="true">
                    <template>
                        <el-descriptions class="margin-top" :column="3" :size="size" border>
                            <el-descriptions-item>
                                <template slot="label">
                                    <i class="el-icon-user"></i>
                                    患者ID
                                </template>
                                {{backPatientID}}
                            </el-descriptions-item>
                            <el-descriptions-item>
                                <template slot="label">
                                    <i class="el-icon-tickets"></i>
                                    病历号
                                </template>
                                {{record}}
                            </el-descriptions-item>
                            <el-descriptions-item>
                                <template slot="label">
                                    <i class="el-icon-document"></i>
                                    输血单号
                                </template>
                                {{backTransfusionNumber}}
                            </el-descriptions-item>
                            <el-descriptions-item>
                                <template slot="label">
                                    <i class="el-icon-notebook-2"></i>
                                    血液编号
                                </template>
                                {{backBloodId}}
                            </el-descriptions-item>
                            <el-descriptions-item>
                                <template slot="label">
                                    <i class="el-icon-s-order"></i>
                                    退血单号
                                </template>
                                {{backNumber}}
                            </el-descriptions-item>
                            <el-descriptions-item>
                                <template slot="label">
                                    <i class="el-icon-edit"></i>
                                    退血原因
                                </template>
                                <el-form-item label="" prop="selectValue">
                                    <el-select v-model="ruleForm.selectValue" placeholder="请选择退血原因"
                                               @change="selectBackReason">
                                        <el-option
                                                v-for="item in options"
                                                :key="item.code"
                                                :label="item.reason"
                                                :value="item.reason"
                                                :disabled="item.disabled"
                                        />
                                    </el-select>
                                </el-form-item>
                            </el-descriptions-item>
                            <el-descriptions-item>
                                <template slot="label">
                                    <i class="el-icon-user"></i>
                                    申请人姓名
                                </template>
                                <el-form-item label="" prop="selectName">
                                    <el-select v-model="ruleForm.selectName" placeholder="请选择申请人姓名"
                                               @change="selectAppName">
                                        <el-option
                                                v-for="item in nameList"
                                                :key="item.code"
                                                :label="item.name"
                                                :value="item.code"
                                                :disabled="item.disabled"
                                        />
                                    </el-select>
                                </el-form-item>
                            </el-descriptions-item>
                            <el-descriptions-item>
                                <template slot="label">
                                    <i class="el-icon-s-platform"></i>
                                    申请人工号
                                </template>
                                <el-input placeholder="请选择申请人工号" v-model="backApplicantWorkNumber" disabled></el-input>
                            </el-descriptions-item>
                            <el-descriptions-item>
                                <template slot="label">
                                    <i class="el-icon-share"></i>
                                    申请时间
                                </template>
                                <el-form-item label="" prop="backApplyTime">
                                    <el-date-picker
                                            v-model="ruleForm.backApplyTime"
                                            type="date"
                                            placeholder="选择日期"
                                            size="small"
                                            format="yyyy-MM-dd">
                                    </el-date-picker>
                                </el-form-item>
                            </el-descriptions-item>
                        </el-descriptions>
                    </template>
                </el-form>
                <div slot="footer" class="dialog-footer" align="center">
                    <el-button @click="cancel()">重 置</el-button>
                    <el-button type="primary" @click="save()">提 交</el-button>
                </div>
            </template>
        </el-dialog>

    </template>
</div>

<script src="../../../../plugins/vue-2.6.11/vue.js"></script>
<script src="../../../../plugins/axios-0.27.2/axios.min.js"></script>
<script src="../../../../icons/iconfont.js"></script>
<script src="/js/2.15.12/index.js"></script>
<link href="/css/2.15.12/index.min.css" rel="stylesheet">
<script src="/js/httpVueLoader.js"></script>
<script src="/js/jquery.min.js"></script>
<script>Vue.prototype.$ELEMENT = {size: 'medium'};</script>
<script type="module">
    (
        function () {
            new Vue({
                el: '.data-manage-table',
                data() {
                    return {
                        // 表单校验
                        ruleForm: {
                            selectValue: '',
                            selectName: '',
                            backApplyTime: undefined,
                        },
                        rules: {
                            selectValue: [
                                {required: true, message: '请选择退血原因', trigger: 'change'}
                            ],
                            selectName: [
                                {required: true, message: '请选择申请人姓名', trigger: 'change'}
                            ],
                            backApplyTime: [
                                {type: 'date', required: true, message: '请选择日期', trigger: 'change'}
                            ]
                        },
                        //表格信息
                        tableData: [],
                        transfusionNumber: "",
                        setData: false,
                        backPatientID: undefined,
                        backTransfusionNumber: undefined,
                        backBloodId: undefined,
                        backBackBloodReason: undefined,
                        backApplicantName: undefined,
                        backApplicantWorkNumber: undefined,
                        record: undefined,
                        options: [
                            {
                                code: '01',
                                reason: 'ALT升高',
                            },
                            {
                                code: '02',
                                reason: 'HBsAg反应性',
                            },
                            {
                                code: '03',
                                reason: 'HCV抗原抗体联合检测反应性'
                            },
                            {
                                code: '04',
                                reason: 'HIV抗原抗体联合检测反应性'
                            },
                            {
                                code: '05',
                                reason: '梅毒反应性',
                            },
                            {
                                code: '06',
                                reason: '黄疸指数高',
                            },
                            {
                                code: '07',
                                reason: 'ABO血型亚型',
                            },
                            {
                                code: '08',
                                reason: '特殊抗体反应性',
                            },
                            {
                                code: '10',
                                reason: '过期血',
                            },
                            {
                                code: '11',
                                reason: '乳糜血',
                            },
                            {
                                code: '12',
                                reason: '凝块',
                            },
                            {
                                code: '13',
                                reason: '气泡',
                            },
                            {
                                code: '14',
                                reason: '破袋',
                            },
                            {
                                code: '15',
                                reason: '非标量',
                            },
                            {
                                code: '16',
                                reason: '析出',
                            },
                            {
                                code: '17',
                                reason: '保密性弃血',
                            },
                            {
                                code: '18',
                                reason: '标签破损',
                            },
                            {
                                code: '19',
                                reason: 'HIV-DNA检测反应性',
                            },
                            {
                                code: '20',
                                reason: 'HBV-DNA检测反应性',
                            },
                            {
                                code: '21',
                                reason: 'HCV-RNA检测反应性',
                            },
                            {
                                code: '22',
                                reason: '冷凝集',
                            },
                            {
                                code: '23',
                                reason: '溶血',
                            },
                            {
                                code: '24',
                                reason: '脂肪血',
                            },
                            {
                                code: '25',
                                reason: '热合口漏',
                            },
                            {
                                code: '26',
                                reason: '血型错误',
                            },
                            {
                                code: '27',
                                reason: '血小板聚集',
                            },
                            {
                                code: '28',
                                reason: '人为差错',
                            },
                            {
                                code: '99',
                                reason: '其他',
                            },
                        ],
                        nameList: [
                            {
                                code: '01',
                                name: '张三'
                            },
                            {
                                code: '02',
                                name: '李四'
                            },
                            {
                                code: '03',
                                name: '王五'
                            },
                            {
                                code: '04',
                                name: '赵六'
                            },
                            {
                                code: '05',
                                name: '钱七'
                            },
                            {
                                code: '06',
                                name: '孙八'
                            },
                            {
                                code: '07',
                                name: '周九'
                            },
                            {
                                code: '08',
                                name: '吴十'
                            },
                        ],
                        pId: undefined,
                        pTd: undefined,
                        id: undefined,
                        backNumber: undefined,
                        size: '',
                        user: {
                            "accountNonExpired": true,
                            "accountNonLocked": true,
                            "credentialsNonExpired": true,
                            "enable": false,
                            "enabled": false,
                            "jobnum": "",
                            "menuUrls": {
                                "menu": [{
                                    "urls": [{
                                        "id": "11",
                                        "title": "11",
                                        "url": "/pages/error/403.html",
                                        "titleflag": "error"
                                    }], "title": "testerror", "titleflag": "error"
                                }, {
                                    "urls": [{
                                        "id": "22",
                                        "title": "5-5",
                                        "url": "/pages/error/505.html",
                                        "titleflag": "testerror"
                                    }], "title": "testerror2", "titleflag": "testerror"
                                }]
                            },
                            "noLocked": false,
                            "personalization": {
                                "asideFold": false,
                                "mainTabsHeaderFixed": true,
                                "asideControlOpen": false,
                                "headerSkin": "colorful",
                                "headerFixed": false,
                                "skin": "brown",
                                "asideSkin": "dark",
                                "asideControlFixed": true
                            },
                            "username": ""
                        },
                        //分页相关信息
                        pagination: {
                            currentPage: 1, //当前页码
                            pageSize: 4, //每页显示记录数
                            total: 0, //总记录数
                        },
                        dataList: [],
                        sData: false,
                        shData: {
                            sTransfusionNumber: "",
                            sGmtCreate: "",
                            sGmtModified: "",
                            sPatientId: "",
                            sCreateTime: "",
                            sBloodType: "",
                            sBloodCount: "",
                            sDepartMent: "",
                            sState: "",
                            sBloodId: "",
                            sName: "",
                            sPayMoney: "",
                            sAboBloodType: "",
                            sRhBloodType: "",
                        },
                        //血液状态列表
                        stateList: [],
                        // 部门列表
                        departmentList: [],
                        // 血液数量列表
                        bloodSizeList: [],
                        backReasonList: [],
                        // ABO血型
                        aboTypeList: [],
                        // RH血型
                        rhTypeList: [],
                    }
                },
                mounted() {
                    this.user = sessionStorage.getItem("user") ? JSON.parse(sessionStorage.getItem("user")) : {};
                    this.getState();
                    this.getDepartment();
                    this.getBloodSize();
                    this.getBackBloodReason();
                    this.getAboType();
                    this.getRhType();
                },
                methods: {
                    search() {
                        const urlGet = '/bloodcanclepatient/normal/getapplication/' + this.pagination.currentPage + '/' + this.pagination.pageSize;
                        if (this.record === "") {
                            this.$message.success("请输入待退血患者病历号");
                        } else {
                            axios.get(
                                urlGet,
                                {
                                    params: {
                                        number: this.record,
                                    }
                                }
                            ).then(res => {
                                console.log(res.data);
                                if (res.data.code === "200") {
                                    this.pagination.pageSize = res.data.data.size;
                                    this.pagination.currentPage = res.data.data.current;
                                    this.pagination.total = res.data.data.total;
                                    this.dataList = res.data.data.records;
                                } else {
                                    this.$message.error(res.data.msg);
                                }
                            })
                        }
                    },
                    // 获取RH血型字典
                    getRhType() {
                        axios.get('/rhType/normal/getName')
                            .then((res) => {
                                if (res.data.code === '200') {
                                    this.rhTypeList = res.data.data
                                } else {
                                    this.$notify.error({
                                        title: '错误',
                                        message: '获取数据失败'
                                    })
                                }
                            })
                    },
                    // 将表格中的RhType字段的code转换成name
                    getRhTypeName(code) {
                        for (let i = 0; i < this.rhTypeList.length; i++) {
                            if (this.rhTypeList[i].code == code) {
                                return this.rhTypeList[i].name;
                            }
                        }
                    },
                    // 获取ABO血型字典
                    getAboType() {
                        axios.get('/aboType/normal/getName')
                            .then((res) => {
                                if (res.data.code === '200') {
                                    this.aboTypeList = res.data.data
                                } else {
                                    this.$notify.error({
                                        title: '错误',
                                        message: '获取数据失败'
                                    })
                                }
                            })
                    },
                    // 将表格中的AboType字段的code转换成name
                    getAboTypeName(code) {
                        for (let i = 0; i < this.aboTypeList.length; i++) {
                            if (this.aboTypeList[i].code == code) {
                                return this.aboTypeList[i].name;
                            }
                        }
                    },
                    // 批量下载
                    batchDownload() {
                        if (JSON.parse(JSON.stringify(this.$refs.backApplicationTable.selection)).length == 0) {
                            this.$notify({
                                title: '温馨提示：',
                                message: '您未选中数据，请重新操作！！！',
                                type: 'warning'
                            });
                            return;
                        }
                        let checkArr = JSON.parse(JSON.stringify(this.$refs.backApplicationTable.selection));  // 存储了勾选到的数据
                        var ids = new Array()
                        for (var i = 0; i < checkArr.length; i++) {
                            ids[i] = checkArr[i].id;
                        }
                        // 批量下载
                        this.$confirm('确定下载这些数据吗, 是否继续?', '批量打印', {
                            confirmButtonText: '确定',
                            cancelButtonText: '取消',
                            type: 'warning'
                        }).then(() => {
                            const a = document.createElement('a')
                            a.href = '/bloodcanclepatient/normal/batchdownloadpba?' + 'ids=' + ids
                            a.click()
                        });
                    },
                    // 分页查询 每页显示多少条数据
                    handleSizeChange: function (pageSize) {
                        this.pagination.pageSize = pageSize;
                        this.search()
                    },
                    //分页查询 切换页码
                    handleCurrentChange: function (currentPage) {
                        this.pagination.currentPage = currentPage;
                        //执行查询
                        this.search()
                    },
                    // 获取状态字典
                    getState() {
                        axios.get('/state/normal/getName')
                            .then((res) => {
                                if (res.data.code === '200') {
                                    this.stateList = res.data.data
                                } else {
                                    this.$notify.error({
                                        title: '错误',
                                        message: '获取数据失败'
                                    })
                                }
                            })
                    },
                    // 将表格中的State字段的code转换成name
                    getStateName(code) {
                        for (let i = 0; i < this.stateList.length; i++) {
                            if (this.stateList[i].code === code) {
                                return this.stateList[i].state;
                            }
                        }
                    },
                    // 获取退血原因字典
                    getBackBloodReason() {
                        axios.get('/backbloodreason/normal/query')
                            .then((res) => {
                                if (res.data.code === '200') {
                                    this.backReasonList = res.data.data
                                } else {
                                    this.$notify.error({
                                        title: '错误',
                                        message: '获取数据失败'
                                    })
                                }
                            })
                    },
                    // 将表格中的BackBloodReason字段的code转换成name
                    getBackBloodReasonName(code) {
                        for (let i = 0; i < this.backReasonList.length; i++) {
                            if (this.backReasonList[i].code === code) {
                                return this.backReasonList[i].reason;
                            }
                        }
                    },
                    // 将name转换成code
                    getBackBloodReasonCode(reason) {
                        for (let i = 0; i < this.backReasonList.length; i++) {
                            if (this.backReasonList[i].reason === reason) {
                                return this.backReasonList[i].code;
                            }
                        }
                    },
                    // 获取部门字典
                    getDepartment() {
                        axios.get('/department/normal/getDepartment')
                            .then((res) => {
                                if (res.data.code === '200') {
                                    this.departmentList = res.data.data
                                } else {
                                    this.$notify.error({
                                        title: '错误',
                                        message: '获取数据失败'
                                    })
                                }
                            })
                    },
                    // 将表格中的Department字段的code转换成name
                    getDepartmentName(code) {
                        for (let i = 0; i < this.departmentList.length; i++) {
                            if (this.departmentList[i].code === code) {
                                return this.departmentList[i].name;
                            }
                        }
                    },
                    // 获取血液数量字典
                    getBloodSize() {
                        axios.get('/bloodSize/normal/getName1')
                            .then((res) => {
                                if (res.data.code === '200') {
                                    this.bloodSizeList = res.data.data
                                } else {
                                    this.$notify.error({
                                        title: '错误',
                                        message: '获取数据失败'
                                    })
                                }
                            })
                    },
                    // 将表格中的BloodSize字段的code转换成size
                    getBloodSizeName(code) {
                        for (let i = 0; i < this.bloodSizeList.length; i++) {
                            if (this.bloodSizeList[i].code == code) {
                                return this.bloodSizeList[i].size;
                            }
                        }
                    },
                    getBackNumber() {
                        axios({
                            method: "get",
                            url: "/bloodcanclepatient/normal/getbacknumber",
                            params: {
                                id: this.id,
                            },
                            headers: {
                                'Content-Type': 'application/json;charset=UTF-8'
                            }
                        }).then(
                            res => {
                                console.log(res.data.data);
                                this.backNumber = res.data.data;
                            }
                        );
                    },
                    selectAppName(val) {
                        let obj = {};//定义对象集合
                        obj = this.nameList.find(item => {
                            return item.code === val; //筛选出匹配数据 返回对象
                        });
                        this.backApplicantName = obj.name;
                        this.backApplicantWorkNumber = obj.code;
                    },
                    selectBackReason(val) {
                        console.log(val);
                        this.backBackBloodReason = val;
                    },
                    reset() {
                        this.record = "";
                        this.pId = "";
                        this.pTd = "";
                        this.dataList = undefined;
                    },
                    backBlood() {
                        this.setData = true;
                    },
                    showData() {
                        this.sData = true;
                    },
                    handle(row) {
                        console.log(row);
                        this.backPatientID = row["patientId"];
                        this.backTransfusionNumber = row["transfusionNumber"];
                        this.backBloodId = row["bloodId"];
                        this.id = row["id"];
                        this.shData.sTransfusionNumber = row["transfusionNumber"];
                        this.shData.sGmtCreate = row["gmtCreate"];
                        this.shData.sGmtModified = row["gmtModified"];
                        this.shData.sPatientId = row["patientId"];
                        this.shData.sCreateTime = row["createTime"];
                        this.shData.sBloodType = row["bloodType"];
                        this.shData.sBloodCount = row["bloodCount"];
                        this.shData.sDepartMent = row["department"];
                        this.shData.sState = row["state"];
                        this.shData.sBloodId = row["bloodId"];
                        this.shData.sName = row["name"];
                        this.shData.sPayMoney = row["payMoney"];
                        this.shData.sAboBloodType = row["aboBloodType"];
                        this.shData.sRhBloodType = row["rhBloodType"];
                        // 获取患者退血单号
                        this.getBackNumber();
                    },
                    save() {
                        this.$refs.ruleForm.validate((valid) => {
                            if (valid) {
                                const params = {};
                                params.backInformationNumber = this.backNumber;
                                params.patientId = this.backPatientID;
                                params.transfusionNumber = this.backTransfusionNumber;
                                params.backBloodReason = this.getBackBloodReasonCode(this.backBackBloodReason);
                                params.applicantName = this.backApplicantName;
                                params.applicantWorkNumber = this.backApplicantWorkNumber;
                                params.applyTime = this.ruleForm.backApplyTime;
                                axios({
                                    method: "post",
                                    url: "/bloodcanclepatient/normal/application",
                                    data: params,
                                    headers: {
                                        'Content-Type': 'application/json;charset=UTF-8'
                                    }
                                }).then(res => {
                                    console.log(res.data);
                                    if (res.data.code === "200") {
                                        this.search();
                                        this.setData = false;
                                        this.$message.success("保存成功");
                                    } else {
                                        this.$message.error(res.data.msg);
                                    }
                                });
                                this.search();
                            } else {
                                console.log('提交有误！');
                                return false;
                            }
                        })
                    },
                    //重置按钮
                    cancel() {
                        this.$refs.ruleForm.resetFields();
                    }
                }
            });
        })()
</script>

<style>
    .el-form-item {
        margin-bottom: 0px;
    }
</style>

</body>
</html>